<?php

namespace app\index\controller;

use app\BaseController;
use app\common\model\ShortUrlModel;
use think\facade\View;


class Video extends BaseController
{
    public function index(): \think\response\View
    {
        $str = input('id','');
        $url = (new ShortUrlModel())->where('short_url',$str)->findOrEmpty()->toArray();
        if(!$url){
            var_dump('出错了');exit();
        }
        header('Location:'.$url['url']);exit();
        view::assign('url',base64_encode($url['url']));
        view::assign('title',$url['title']);
        return view('video/index');
    }

}